package com.huterox.todoscheduler.exception;

import java.io.Serializable;

/**
 * 顶级异常
 * */
public class TodoException extends Exception implements Serializable {


    private int errorCode;

    public TodoException() {
    }

    public TodoException(String message, int errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public int getErrorCode(){
        return this.errorCode;
    }

    public TodoException(String message) {
        super(message);
    }

    public TodoException(String message, Throwable cause) {
        super(message, cause);
    }

    public TodoException(Throwable cause) {
        super(cause);
    }

    public TodoException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    @Override
    public String toString() {
        return "TodoError: " + getMessage() + ", ErrorCode: " + errorCode;
    }
}
